package com.ruoyi.hospital.service.doctor.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.hospital.domain.doctor.DocIncome;
import com.ruoyi.hospital.domain.vo.DocIncomeListVo;
import com.ruoyi.hospital.domain.vo.DocIncomeVo;
import com.ruoyi.hospital.mapper.doctor.DocIncomeMapper;
import com.ruoyi.hospital.service.doctor.IDocIncomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 医生收入Service业务层处理
 * 
 * @author wendao
 * @date 2025-06-25
 */
@Service
public class DocIncomeServiceImpl implements IDocIncomeService
{
    @Autowired
    private DocIncomeMapper docIncomeMapper;

    /**
     * 查询医生收入
     * 
     * @param id 医生收入主键
     * @return 医生收入
     */
    @Override
    public DocIncome selectDocIncomeById(Integer id)
    {
        return docIncomeMapper.selectDocIncomeById(id);
    }

    @Override
    public DocIncome selectDocIncomeBy3(Integer docId, Integer incomeType, Integer orderId) {
        return docIncomeMapper.selectDocIncomeBy3(docId, incomeType, orderId);
    }

    /**
     * 查询医生收入列表
     * 
     * @param docIncome 医生收入
     * @return 医生收入
     */
    @Override
    public List<DocIncome> selectDocIncomeList(DocIncome docIncome)
    {
        return docIncomeMapper.selectDocIncomeList(docIncome);
    }

    /**
     * 新增医生收入
     * 
     * @param docIncome 医生收入
     * @return 结果
     */
    @Override
    public int insertDocIncome(DocIncome docIncome)
    {
        docIncome.setCreateTime(DateUtils.getNowTimeSecond());
        return docIncomeMapper.insertDocIncome(docIncome);
    }

    /**
     * 修改医生收入
     * 
     * @param docIncome 医生收入
     * @return 结果
     */
    @Override
    public int updateDocIncome(DocIncome docIncome)
    {
        return docIncomeMapper.updateDocIncome(docIncome);
    }

    /**
     * 批量删除医生收入
     * 
     * @param ids 需要删除的医生收入主键
     * @return 结果
     */
    @Override
    public int deleteDocIncomeByIds(Integer[] ids)
    {
        return docIncomeMapper.deleteDocIncomeByIds(ids);
    }

    /**
     * 删除医生收入信息
     * 
     * @param id 医生收入主键
     * @return 结果
     */
    @Override
    public int deleteDocIncomeById(Integer id)
    {
        return docIncomeMapper.deleteDocIncomeById(id);
    }

    @Override
    public DocIncomeVo getIncomeStatistics() {
        return docIncomeMapper.getIncomeStatistics();
    }

    @Override
    public List<DocIncomeListVo> getIncomeStatisticsList() {
        return docIncomeMapper.getIncomeStatisticsList();
    }
}
